package com.bmf.module.rbac.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bmf.module.rbac.entity.RbacRolePerm;
import com.bmf.module.rbac.service.RbacRolePermService;
import com.bmf.module.rbac.vo.RbacRolePermCreateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import com.bmf.core.result.R;

/**
 * (RbacRolePerm)表控制层
 *
 * @author makejava
 * @since 2022-12-27 15:33:18
 */
@RestController
@RequestMapping("rbacRolePerm")
@Api(tags = {"角色权限接口"})
public class RbacRolePermController{
    /**
     * 服务对象
     */
    @Autowired
    private RbacRolePermService rbacRolePermService;

    /**
     * 分页查询所有数据
     *
     * @return 所有数据
     */
    @GetMapping("/{roleId}")
    @ApiOperation(value = "查询")
    public R<List<Integer>> selectAll(@PathVariable("roleId") Integer roleId) {
        return R.success(rbacRolePermService.selectAll(roleId));
    }


    /**
     * 新增数据
     *
     * @param rbacRolePermCreateVo 实体对象
     * @return 新增结果
     */
    @PostMapping
    @ApiOperation(value = "新增数据")
    public R<Void> insert(@RequestBody RbacRolePermCreateVo rbacRolePermCreateVo) {
        rbacRolePermService.insert(rbacRolePermCreateVo);
        return R.ok();
    }


}

